package edu.llg.cli;

import edu.llg.cli.command.ConfigCommand;
import edu.llg.cli.command.GenerateCommand;
import edu.llg.cli.command.ListCommand;
import picocli.CommandLine;

/**
 * @author 隆利果
 * @version 1.0
 * @date 2024/2/23 14:31
 * 当 ConfigCommand 做为子命令时，@Command中的name为子命令名称，而 CommandExecutor 不为子命令所以 name = "xiaolong" 无效
 */
@CommandLine.Command(name = "xiaolong",mixinStandardHelpOptions = true)
public class CommandExecutor implements Runnable {
    private CommandLine commandLine;

    {
        commandLine = new CommandLine(this).addSubcommand(new ConfigCommand()).addSubcommand(new GenerateCommand()).addSubcommand(new ListCommand());
    }

    @Override
    public void run() {
    }

    public void executor(String[] args){
        commandLine.execute(args);
    }
}
